
package com.zsrt.day20170406;

import org.junit.Test;

/**
 * 测试
 * 
 * @author jmj
 * @date 2017年4月6日
 * @time 上午10:50:33
 */

public class Fangfa02Test {
	
	@Test
	public void addTest() throws Exception {
		int sum = add(10,20);
		System.out.println(sum);
	}
	
	@Test
	public void subTest() throws Exception {
		int result1 = sub(20,10);
		System.out.println(result1);
		
	}
	
	@Test
	public void mulTest() throws Exception {
		int result2 = mul(20,10);
		System.out.println(result2);
		
	}
	
	@Test
	public void chuTest() throws Exception {
		int result3 = chu(20,10);
		System.out.println(result3);
	}
	
	@Test
	public void moTest() throws Exception {
		int result4 = mo(20,10);
		System.out.println(result4);
	}

	
	/**
	 * 加法
	 * 
	 * @param a
	 * @param b
	 * @return
	 */
	
	public int add(int a , int b){
		int sum = a+b;
		return sum;	
	}
	
	/**
	 * 减法
	 * @param a
	 * @param b
	 * @return
	 */
	public int sub(int a , int b){
		int result1 = a-b;
		return result1;
	}
	
	/**
	 * 乘法
	 * @param a
	 * @param b
	 * @return
	 */
	public int mul(int a , int b){
		int result2 = a*b;
		return result2;
	}
	
	/**
	 * 除法
	 * @param a
	 * @param b
	 * @return
	 */
	public int chu(int a , int b){
		int result3 = a/b;
		return result3;
	}
	
	/**
	 * 求模
	 * @param a
	 * @param b
	 * @return
	 */
	public int mo(int a , int b){
		int result4 = a%b;
		return result4;
		
	}
}
